<?php if (!defined('THINK_PATH')) exit(); echo W('Nav',array('name'=>'商品列表','act'=>'添加商品','URL'=>'addGoods'));?>
<script type="text/javascript" src="__PUBLIC__/Js/js/utils.js"></script><script type="text/javascript" src="__PUBLIC__/Js/js/listtable.js"></script><!-- 商品搜索 -->
<!-- $Id: goods_search.htm 16790 2009-11-10 08:56:15Z wangleisvn $ -->
<div class="form-div">
    <form action="javascript:searchGoods()" name="searchForm">
        <img src="__PUBLIC__/Images/images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH"/>
        <!-- 分类 -->
        <select name="cat_id">
            <option value="0">所有分类</option>
        </select>
        <!-- 上架 -->
        <select name="is_on_sale">
            <option value=''>全部</option>
            <option value="1">上架</option>
            <option value="0">下架</option>
        </select>
        <!-- 审核状态-->
        <select name="is_check">
            <option value=''>全部</option>
            <option value="5">未审核</option>
            <option value="1">审核提交</option>
            <option value="2">药师审核通过</option>
            <option value="3">审核管理员审核通过</option>
        </select>

        +

        <!-- 关键字 -->
        关键字 <input type="text" name="keyword" size="15"/>

        <input type="submit" value=" 搜索 " class="button"/>
    </form>
</div>


<script language="JavaScript">
    function searchGoods()
    {

        listTable.filter['cat_id'] = document.forms['searchForm'].elements['cat_id'].value;

        listTable.filter['brand_id'] = document.forms['searchForm'].elements['brand_id'].value;
        listTable.filter['intro_type'] = document.forms['searchForm'].elements['intro_type'].value;
        listTable.filter['suppliers_id'] = document.forms['searchForm'].elements['suppliers_id'].value;
        listTable.filter['is_on_sale'] = document.forms['searchForm'].elements['is_on_sale'].value;
        listTable.filter['is_check'] = document.forms['searchForm'].elements['is_check'].value;

        listTable.filter['keyword'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
        listTable.filter['page'] = 1;

        listTable.loadList();
    }
</script>
<!-- 商品列表 -->
<form method="post" action="" name="listForm" onsubmit="return confirmSubmit(this)">
    <!-- start goods list -->
    <div class="list-div" id="listDiv">
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th>
                    <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
                    <a href="javascript:listTable.sort('goods_id'); ">编号</a><img src="__PUBLIC__/Images/images/sort_desc.gif"/>        </th>
                <th><a href="javascript:listTable.sort('goods_name'); ">商品名称</a></th>
                <th><a href="javascript:listTable.sort('goods_sn'); ">货号</a></th>
                <th><a href="javascript:listTable.sort('shop_price'); ">价格</a></th>
                <th><a href="javascript:listTable.sort('is_on_sale'); ">上架</a></th>
                <th><a href="javascript:listTable.sort('examine_status'); ">审核状态</a></th>
                <th><a href="javascript:listTable.sort('sort_order'); ">推荐排序</a></th>
                <th><a href="javascript:listTable.sort('goods_number'); ">库存</a></th>
                <th><a href="javascript:listTable.sort('virtual_sales'); ">虚拟销量</a></th>
                <th>操作</th>
            </tr>
            <?php if(is_array($goodsArr)): foreach($goodsArr as $key=>$v): ?><tr>
                    <td><input type="checkbox" name="checkboxes[]" value="4252" /><?php echo ($v["id"]); ?></td>
                    <td class="first-cell" style=""><span onclick="listTable.edit(this, 'edit_goods_name', 4252)"><?php echo ($v["name"]); ?></span></td>
                    <td><span onclick="listTable.edit(this, 'edit_goods_sn', 4252)"><?php echo ($v["goods_sn"]); ?></span></td>
                    <td align="right"><span onclick="listTable.edit(this, 'edit_goods_price', 4252)"><?php echo ($v["shop_price"]); ?> </span></td>
                    <td align="center"><img src="__PUBLIC__/Images/images/<?php if($v["is_sale"] == 1): ?>yes<?php else: ?>no<?php endif; ?>.gif" onclick="listTable.toggle(this, 'toggle_on_sale', 4252)" /></td>
                    <td align="center">
                        <?php if($v["status"] == 3): ?>审核管理员审核通过
                            <?php elseif($v["status"] == 1): ?>审核通过
                            <?php elseif($v["status"] == 2): ?>药师审核通过
                            <?php else: ?>未审核<?php endif; ?>
                    </td>
                    <td align="center"><span onclick="listTable.edit(this, 'edit_sort_order', 4252)"><?php echo ($v["sort"]); ?></span></td>
                    <td align="right"><span onclick="listTable.edit(this, 'edit_goods_number', 4252)"><?php echo ($v["num"]); ?></span></td>
                    <td align="center"><span onclick="listTable.edit(this, 'edit_virtual_sales', 4252)"><?php echo ($v["sale_num"]); ?></span></td>
                    <td align="center">
                        <a href="<?php echo U('/Index/Goods/index/'.$v['id']);?>" target="_blank" title="查看"><img src="__PUBLIC__/Images/images/icon_view.gif" width="16" height="16" border="0" /></a>
                        <a href="<?php echo U(GROUP_NAME.'/Goods/toTrach/',array('type'=>'0','id'=>$v['id']));?>" title="还原"><img src="__PUBLIC__/Images/images/icon_edit.gif" width="16" height="16" border="0" /></a>
                        <a href="<?php echo U('/Goods/delete',array('id'=>$v['id']));?>"title="彻底删除"><img src="__PUBLIC__/Images/images/icon_trash.gif" width="16" height="16" border="0" /></a>
                        <img src="__PUBLIC__/Images/images/empty.gif" width="16" height="16" border="0" />                          </td>
                </tr><?php endforeach; endif; ?>
        </table>
        <!-- end goods list -->
        <!-- 分页 -->
        <table id="page-table" cellspacing="0">
            <tr>
                <td align="right" nowrap="true">
                    <!-- $Id: page.htm 14216 2008-03-10 02:27:21Z testyang $ -->
                    <div id="turn-page">
                        总计  <span id="totalRecords">2905</span>
                        个记录分为 <span id="totalPages">194</span>
                        页当前第 <span id="pageCurrent">1</span>
                        页，每页 <input type='text' size='3' id='pageSize' value="15" onkeypress="return listTable.changePageSize(event)" />
        <span id="page-link">
          <a href="javascript:listTable.gotoPageFirst()">第一页</a>
          <a href="javascript:listTable.gotoPagePrev()">上一页</a>
          <a href="javascript:listTable.gotoPageNext()">下一页</a>
          <a href="javascript:listTable.gotoPageLast()">最末页</a>
          <select id="gotoPage" onchange="listTable.gotoPage(this.value)">
            <option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='194'>194</option>          </select>
        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</form>
</body>
</html>